<template>
	<div>
		<Loading></Loading>
		<Banner :propbannerlist='data_bannerlist'></Banner>
		<Icons></Icons>
		<Menus></Menus>
		<Spike :propspike='data_spike' :propking='kingProduct' :propnew='newProduct'></Spike>
		<NewUserHB></NewUserHB>
		<WaterfallFlow></WaterfallFlow>
		<BottomNav topage=1></BottomNav>
	</div>
</template>

<script>
import Banner from './pages/Banner';
import Icons from './pages/Icons';
import Menus from './pages/Menus';
//限时特惠
import Spike from './pages/Spike';
//瀑布流
import WaterfallFlow from './pages/WaterfallFlow';
// 新用户注册红包
import NewUserHB from '../default/NewUserHB';
// 引入公共子组件——底部
import BottomNav from '../default/BottomNav';
//加载中弹窗
import Loading from '../default/Loading';
export default {
	name:'Home',
	components:{
		Loading,
		Banner,
		Icons,
		Menus,
		Spike,
		WaterfallFlow,
		NewUserHB,
		BottomNav
	},
	data(){
		return {
			data_bannerlist:[],//轮播图
			data_spike:[],//限时特惠
			kingProduct:[],//爆品线路
			newProduct:[],//新品推荐
		}
	},
	created() {
		this.getspikeVal();
	},
	methods:{
		getspikeVal(){
			//显示加载中弹窗
			this.$store.commit('sload');
			let url = 'https://m.youxiake.com/api/m/index/part?uid=&sitecode=1&city_id=1&refreshCount=68';
			let that = this;
			this.axios.get(url).then((res)=>{
				if(res.status==200){
					// console.log(res);
					that.data_bannerlist = res.data.data.flashImageList;//轮播图
					that.data_spike  = res.data.data.saleProductList;//限时特惠
					that.kingProduct = res.data.data.kingProduct.recommendList;//爆品线路
					that.newProduct  = res.data.data.newProduct.recommendList;//新品推荐
				}
				//隐藏加载中弹窗
				this.$store.commit('hload');
			})
		}
	}
}
</script>

<style scoped>
	.iconfont {
	  font-family: "iconfont" !important;
	  font-size: 26px;
	  font-style: normal;
	  -webkit-font-smoothing: antialiased;
	  -moz-osx-font-smoothing: grayscale;
	}
</style>
